#include<stdio.h>
int main()
{
    int a[1000]={0};
    int i=0,count=0;
    while(scanf("%d",&a[i])==1)
    {
        if(a[i]==0)
        {
            break;
        }
        i++;
        count++;
    }
    int j=0,k=count-1;
    while(j<=k)
    {
        int temp=a[j];
        a[j]=a[k];
        a[k]=temp;
        j++;
        k--;
    }
    for(int i=0;i<count;i++)
    {
        printf("%d ",a[i]);
    }
    return 0;
}